/*
 * @Autor: dlb
 * @Date: 2020-10-24 21:52:20
 * @LastEditors: dlb
 * @description: 项目构建配置
 * @LastEditTime: 2020-10-25 11:52:18
 */

const path = require('path')
const resolve = filePath => path.join(__dirname, './', filePath)
module.exports = {
    outputDir: 'docs',
    publicPath: './',
    // 配置端口
    devServer: {
        port: '3366'
    },
    // 配置页面
    pages: {
        index: {
            entry: resolve('story/main.ts'),// 配置单页面入口文件
            template: 'public/index.html',// 配置模板文件
            filename: 'index.html',//配置入口文件名
            title: 'v3-components'
        }
    },
    // webpack配置
    chainWebpack: config => {
        // 插件配置
        config.plugins.delete('prefetch-index').delete("preloads-index") 
        // 设置目录别名
        config.resolve.alias.set('story',resolve('story'))
    }
}